/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entity;

import java.io.Serializable;
import javax.persistence.DiscriminatorColumn;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.Transient;


@Entity
@Inheritance
@DiscriminatorColumn(name="PRODUCT_TYPE")
public abstract class Product implements Serializable {

    @Id
    @GeneratedValue(strategy=GenerationType.TABLE)
    private Long id;

    protected double price;
    protected int quantityInStock;
    @Transient
    public abstract String getName();
    public double getPrice()                { return price; }
    public int getQuantityInStock()         { return quantityInStock; }
    public void setPrice(double price)      { this.price = price; }
    @Id
    public Long getId()                     { return id; }
}
